package com.jf.apply_car.controller;

import com.jf.apply_car.service.EchartsService;
import com.jf.apply_car.util.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/echarts")
@ResponseBody
public class EchartsController {
    @Autowired
    private EchartsService echartsService;

    @GetMapping("/pie")
    public ResultJson pie() {
        return echartsService.getPieData();
    }

    @GetMapping("/bar")
    public ResultJson bar() {
        return echartsService.getBarData();
    }

    @GetMapping("/line")
    public ResultJson line() {
        return echartsService.getLineData();
    }

}
